#
# "@(#) $Id: backtick.py,v 1.1.1.1 2006-07-27 03:16:08 gioshe Exp $"
#
# This work is released under the GNU GPL, version 2 or later.
#
import os

def backtick(cmd):
	data = ""
	child = os.popen(cmd)
	done = False
	while not done:
		try:
			data = child.read()
			done = True
		except IOError:
			pass
	err = child.close()
	#if err:
	#	raise RuntimeError,"%s failed with exit code %d" %(cmd,err)
	return data
	
if __name__=='__main__':
	print backtick('cdrecord -scanbus | grep -v "*" | grep ","')
